import request from '@/utils/request'

// 查询order列表
export function listOrder(query) {
  return request({
    url: '/mini/order/select',
    method: 'get',
    params: query
  })
}

// 查询order状态标签列表
export function listOrderStatusLabel() {
  return request({
    url: '/mini/orderStatus/typeList',
    method: 'get'
  })
}

// 查询order状态描述列表
export function listOrderStatusTitle() {
  return request({
    url: '/mini/orderStatus/statusTitleList',
    method: 'get'
  })
}

// 根据orderNumber查询退款信息
export function getRefundInfo(query) {
  return request({
    url: '/mini/order/getRefundInfo',
    method: 'get',
    params: query
  })
}

// 批准退款
export function submitRefund(orderNumber) {
  return request({
    url: `/mini/pay/refundOrder/${orderNumber}`,
    method: 'get'
  })
}

// 修改orderUser
export function updateOrder(data) {
  return request({
    url: '/mini/order/updateOrderUser',
    method: 'post',
    data: data
  })
}

// 分配工人
export function updateOrderStaff(serviceLogId, staffId) {
  return request({
    url: `/mini/order/selectStaff/${serviceLogId}/${staffId}`,
    method: 'post'
  })
}

// 根据orderUserId获取服务日志
export function getServiceLog(orderUserId) {
  return request({
    url: `/mini/serviceLog/get/${orderUserId}`,
    method: 'get'
  })
}


